package com.cr.crandroid.activity;

import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;


import com.cr.crandroid.R;
import com.github.appintro.AppIntro;
import com.github.appintro.AppIntroFragment;

public class IntroActivity extends AppIntro {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        addSlide(AppIntroFragment.createInstance("一",
                "", R.drawable.p1, R.color.black_200));
        addSlide(AppIntroFragment.createInstance("二",
                "", R.drawable.p2, R.color.black_200));
        addSlide(AppIntroFragment.createInstance("三",
                "", R.drawable.p3, R.color.black_200));
        addSlide(AppIntroFragment.createInstance("四",
                "", R.drawable.p4, R.color.black_200));
//        addSlide(AppIntroFragment.createInstance("第五日",
//                "爆炸菜单BoomMenu与统计图表MPAndroidChart", R.drawable.p5, R.color.black_200));
//        addSlide(AppIntroFragment.createInstance("第六日",
//                "视频列表与视频播放器GSYVideoPlayer", R.drawable.p6, R.color.black_200));
//        addSlide(AppIntroFragment.createInstance("第七日",
//                "我的界面与基于Bmob后端与登录注册，早会密码", R.drawable.p7, R.color.black_200));
//        addSlide(AppIntroFragment.createInstance("第八日",
//                "百度地图API", R.drawable.p8, R.color.black_200));
        setSeparatorColor(Color.parseColor("#2196F3"));
        setBarColor(Color.parseColor("#2196F3"));
        setSkipText("跳过");
        setDoneText("完成");
        setImmersiveMode();

    }

    @Override
    protected void onSkipPressed(@Nullable Fragment currentFragment) {
        super.onSkipPressed(currentFragment);
        startActivity(new Intent(this, MainActivity.class));
        finish();
    }

    @Override
    protected void onDonePressed(@Nullable Fragment currentFragment) {
        super.onDonePressed(currentFragment);
        startActivity(new Intent(this, MainActivity.class));
        finish();
    }
}
